const mongoose = require('mongoose')
const Schema = mongoose.Schema;
const ObjectId = Schema.ObjectId;

const articleSchema = new Schema({
    title:String,
    author:{
        type:ObjectId,
        ref:'User'
    },
    pubdate:{
        type:Date,
        default:Date.now
    },
    pic:String,
    content:String
})

const Article = mongoose.model('Article',articleSchema)

module.exports = {
    Article
}